import 'package:flutter/material.dart';
import 'package:flutter_adaptive_scaffold/flutter_adaptive_scaffold.dart';
import 'package:go_router/go_router.dart';
import 'package:tetap_ad_batch/common/platform/windows.dart';
import 'package:tetap_ad_batch/common/styles/colorsVariable.dart';
import 'package:tetap_ad_batch/components/user/user_avatar.dart';
import 'package:window_manager/window_manager.dart';

final _destinations = const <BottomNavigationBarItem>[
  BottomNavigationBarItem(
    icon: Icon(Icons.article_outlined),
    activeIcon: Icon(Icons.article),
    label: 'Articles',
  ),
  BottomNavigationBarItem(
    icon: Icon(Icons.person_2_outlined),
    activeIcon: Icon(Icons.person_2),
    label: 'User',
  ),
];

class DashboardLayout extends StatelessWidget {
  final StatefulNavigationShell navigationShell;

  const DashboardLayout({super.key, required this.navigationShell});

  /// This is a simple helper method to convert NavBar items to NavRail items
  NavigationRailDestination _toRailDestination(BottomNavigationBarItem item) =>
      NavigationRailDestination(
        label: Text(item.label!),
        icon: item.icon,
        selectedIcon: item.activeIcon,
      );

  @override
  Widget build(BuildContext context) {
    return DragToResizeArea(
      child: Row(
        children: [
          DragToMoveWrapper(
            child: Container(
              width: 150,
              padding: const EdgeInsets.only(
                  top: 20, bottom: 10, left: 10, right: 10),
              child: Column(
                children: [
                  UserAvatar(),
                  Expanded(
                    child: Container(
                      color: Colors.black,
                    ),
                  ),
                  Padding(padding: const EdgeInsets.only(top: 5)),
                  Row(
                    mainAxisSize: MainAxisSize.max,
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                      IconButton(
                        autofocus: false,
                        tooltip: "设置",
                        onPressed: () {},
                        icon: const Icon(Icons.settings_sharp),
                      ),
                      Padding(padding: const EdgeInsets.only(left: 10)),
                      IconButton(
                        autofocus: false,
                        onPressed: () {},
                        tooltip: "通知",
                        icon: const Icon(Icons.notifications),
                      ),
                    ],
                  ),
                ],
              ),
            ),
          ),
          Expanded(
            child: Container(
              color: Colors.black,
            ),
          ),
        ],
      ),
      // child: Scaffold(
      //   appBar: AppBar(
      //     actions: const [WindowButtons(radius: 0)],
      //   ),
      //   body: Row(
      //     mainAxisSize: MainAxisSize.max,
      //     children: [
      //       Container(
      //         width: 500,
      //         color: Colors.red,
      //       ),
      //     ],
      //   ),
      // ),
    );
  }
}


// Scaffold(
//         appBar: PreferredSize(
//           preferredSize: const Size.fromHeight(40.0),
//           child: DragToMoveWrapper(
//             canDouble: true,
//             child: AppBar(
//               backgroundColor: Colors.transparent,
//               actions: const [
//                 Padding(
//                   padding: EdgeInsets.all(8.0),
//                   child: WindowButtons(),
//                 ),
//               ],
//             ),
//           ),
//         ),
//         body: navigationShell,
//         bottomNavigationBar: BottomNavigationBar(
//           backgroundColor: Colors.transparent,
//           items: const <BottomNavigationBarItem>[
//             BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Section A'),
//             BottomNavigationBarItem(icon: Icon(Icons.work), label: 'Section B'),
//           ],
//           currentIndex: navigationShell.currentIndex,
//           onTap: (int tappedIndex) => navigationShell.goBranch(tappedIndex),
//         ),
//       ),